﻿using BarManager.Core.Entity;
using System.Data.Entity.ModelConfiguration;

namespace BarManager.Infrastructure.Data.Mapping
{
    public class ZonaMap : EntityTypeConfiguration<Zona>
    {
        public ZonaMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Descripcion)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Zonas");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Descripcion).HasColumnName("Descripcion");      
            this.Property(t => t.Habilitada).HasColumnName("Habilitada");      
        }
    }
}
